import {CommonEntity} from "~/common/entity/common.entity";
import {Column, Entity, Index, JoinTable, ManyToMany} from "typeorm";
import {StaffTagEntity} from "~/modules/consult/tag/tag.entity";

@Index(["id"])
@Entity({name: "consult_staff"})
export class StaffEntity extends CommonEntity {
  // 姓名、头像、简介、状态、手机号、评分
  @Column({type: "varchar", length: 10, comment: "姓名"})
  name: string;

  @Column({type: "text", comment: "头像"})
  avatar: string;

  @Column({type: "text", comment: "简介"})
  description: string;

  @Column({type: "tinyint", comment: "状态", default: 1})
  status: number;

  @Column({type: "varchar", length: 20, comment: "手机号"})
  mobile: string;

  @Column({type: "float", comment: "评分"})
  score: number;

  @ManyToMany(() => StaffTagEntity)
  @JoinTable()
  tags: StaffTagEntity[];
}
